package com.ruoyi.womp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.womp.mapper.WompSparePartsMapper;
import com.ruoyi.womp.domain.WompSpareParts;
import com.ruoyi.womp.service.IWompSparePartsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 备件信息Service业务层处理
 * 
 * @author mzz
 * @date 2023-05-11
 */
@Service
public class WompSparePartsServiceImpl implements IWompSparePartsService 
{
    @Autowired
    private WompSparePartsMapper wompSparePartsMapper;

    /**
     * 查询备件信息
     * 
     * @param id 备件信息主键
     * @return 备件信息
     */
    @Override
    public WompSpareParts selectWompSparePartsById(Long id)
    {
        return wompSparePartsMapper.selectWompSparePartsById(id);
    }

    /**
     * 查询备件信息列表
     * 
     * @param wompSpareParts 备件信息
     * @return 备件信息
     */
    @Override
    public List<WompSpareParts> selectWompSparePartsList(WompSpareParts wompSpareParts)
    {
        return wompSparePartsMapper.selectWompSparePartsList(wompSpareParts);
    }

    /**
     * 新增备件信息
     * 
     * @param wompSpareParts 备件信息
     * @return 结果
     */
    @Override
    public int insertWompSpareParts(WompSpareParts wompSpareParts)
    {
        wompSpareParts.setCreateTime(DateUtils.getNowDate());
        return wompSparePartsMapper.insertWompSpareParts(wompSpareParts);
    }

    /**
     * 修改备件信息
     * 
     * @param wompSpareParts 备件信息
     * @return 结果
     */
    @Override
    public int updateWompSpareParts(WompSpareParts wompSpareParts)
    {
        wompSpareParts.setUpdateTime(DateUtils.getNowDate());
        return wompSparePartsMapper.updateWompSpareParts(wompSpareParts);
    }

    /**
     * 批量删除备件信息
     * 
     * @param ids 需要删除的备件信息主键
     * @return 结果
     */
    @Override
    public int deleteWompSparePartsByIds(String ids)
    {
        return wompSparePartsMapper.deleteWompSparePartsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除备件信息信息
     * 
     * @param id 备件信息主键
     * @return 结果
     */
    @Override
    public int deleteWompSparePartsById(Long id)
    {
        return wompSparePartsMapper.deleteWompSparePartsById(id);
    }
}
